<?php /*a:2:{s:70:"D:\laragon\www\ssbeautiful\application\manage\view\user_roles_add.html";i:1542443560;s:60:"D:\laragon\www\ssbeautiful\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>系统</span>
            <span class="icon-angle-right"></span>
            <span>用户管理</span>
            <span class="icon-angle-right"></span>
            <span><?php echo !empty($info) ? '编辑'  :  '添加'; ?>角色</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                            <tr>
                                <th colspan="2"><?php echo !empty($info) ? '编辑'  :  '添加'; ?>角色</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="15%"><label for="name">角色名称<em>*</em></label></td>
                                <td><input type="text" class="u-ipt u-ipt-long" name="name" id="name" placeholder="请输入角色名称" value="<?php echo htmlentities($info['name']); ?>" /></td>
                            </tr>
                            <tr>
                                <td width="15%"><label for="">权限设置</label></td>
                                <td>
                                    <div class="privilege">
                                        <?php if(is_array($menus) || $menus instanceof \think\Collection || $menus instanceof \think\Paginator): if( count($menus)==0 ) : echo "" ;else: foreach($menus as $key1=>$nav): if($nav['status'] == 0): ?>
                                            <div class="privilege-item lay-checked clearfix">
                                                <h2><input type="checkbox" class="select_item_all" lay-skin="primary" title="<?php echo htmlentities($nav['name']); ?>" lay-filter="h2_privilege" /></h2>
                                                <?php if($nav['name'] == 'cms'): if(is_array($nav['child']) || $nav['child'] instanceof \think\Collection || $nav['child'] instanceof \think\Paginator): if( count($nav['child'])==0 ) : echo "" ;else: foreach($nav['child'] as $key2=>$first): if(is_array($first['child']) || $first['child'] instanceof \think\Collection || $first['child'] instanceof \think\Paginator): if( count($first['child'])==0 ) : echo "" ;else: foreach($first['child'] as $key3=>$second): ?>
                                                    <dl class="clearfix"<?php if((count($nav['child']) == $key3+1) OR $key2 == 1): ?> style="padding-bottom: 0; border-bottom: none;"<?php endif; ?>>
                                                        <dt><h3 class="lay-checkbox"><input type="checkbox" class="select_item_all" lay-skin="primary" title="<?php echo htmlentities($second['name']); ?>" lay-filter="h3_privilege" /></h3></dt>
                                                        <?php if(is_array($second['child']) || $second['child'] instanceof \think\Collection || $second['child'] instanceof \think\Paginator): if( count($second['child'])==0 ) : echo "" ;else: foreach($second['child'] as $key4=>$third): ?>
                                                        <dd class="lay-checkbox"><input type="checkbox" name="authorities[]" lay-skin="primary" title="<?php echo htmlentities($third['name']); ?>" value="<?php echo htmlentities($third['url']); ?>"<?php if($info && in_array($third['url'], $info['authorities'])): ?> checked<?php endif; ?> /></dd>
                                                        <?php endforeach; endif; else: echo "" ;endif; ?>
                                                    </dl>
                                                    <?php endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; else: if(is_array($nav['child']) || $nav['child'] instanceof \think\Collection || $nav['child'] instanceof \think\Paginator): if( count($nav['child'])==0 ) : echo "" ;else: foreach($nav['child'] as $key2=>$first): ?>
                                                    <dl class="clearfix"<?php if(count($nav['child']) == $key2+1): ?> style="padding-bottom: 0; border-bottom: none;"<?php endif; ?>>
                                                        <dt><h3 class="lay-checkbox"><input type="checkbox" class="select_item_all" lay-skin="primary" title="<?php echo htmlentities($first['name']); ?>" lay-filter="h3_privilege" /></h3></dt>
                                                        <?php if(is_array($first['child']) || $first['child'] instanceof \think\Collection || $first['child'] instanceof \think\Paginator): if( count($first['child'])==0 ) : echo "" ;else: foreach($first['child'] as $key3=>$second): ?>
                                                        <dd class="lay-checkbox"><input type="checkbox" name="authorities[]" lay-skin="primary" title="<?php echo htmlentities($second['name']); ?>" value="<?php echo htmlentities($second['url']); ?>"<?php if($info && in_array($second['url'], $info['authorities'])): ?> checked<?php endif; ?> /></dd>
                                                        <?php endforeach; endif; else: echo "" ;endif; ?>
                                                    </dl>
                                                <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                            </div>
                                            <?php endif; endforeach; endif; else: echo "" ;endif; ?>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="m-form-btn"><input type="hidden" name="id" value="<?php echo htmlentities($info['id']); ?>"><button id="j_btn" class="u-btn">确定提交</button></div>
                </form>
            </div>
        </div>
    </div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

</body>
</html>